package com.pxample.pemo.service;


import com.alibaba.fastjson.JSONObject;
import com.google.common.util.concurrent.ListenableFuture;
import com.pxample.api.CityScore;
import com.pxample.api.cityscoreGrpc;
import com.pxample.pemo.model.ScoreCalculatorRequest;
import io.grpc.StatusRuntimeException;
import net.devh.boot.grpc.client.inject.GrpcClient;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

import java.math.BigInteger;
import java.util.concurrent.CompletableFuture;

public interface ScoreCalculatorService {

    BigInteger calculateScore (ScoreCalculatorRequest scoreCalculatorRequest);

    CompletableFuture<CityScore.CityScoreResponse> async(CityScore.CityScoreRequest cityScoreRequest);

    CityScore.CityScoreResponse sync(CityScore.CityScoreRequest cityScoreRequest);

    CityScore.CityScoreResponse syncNew(CityScore.CityScoreRequest cityScoreRequest);

    Mono<CityScore.CityScoreResponse> asyncSub(CityScore.CityScoreRequest cityScoreRequest);

    ListenableFuture<CityScore.CityScoreResponse> future(CityScore.CityScoreRequest cityScoreRequest);

    CompletableFuture<JSONObject> asyncMono(CityScore.CityScoreRequest cityScoreRequest);

    CompletableFuture<JSONObject> asyncNewMono(CityScore.CityScoreRequest cityScoreRequest);
}
